home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / progjour / 1991 / 04 / v_puts.c < prev    next >
C/C++ Source or Header  |  1991-05-03  |  732b  |  25 lines

  1. /*    v_puts.c- Write String to Viewport */
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <conio.h>
  6. #include <tools/viewport.h>
  7.  
  8. int v_puts( viewport *v, char *s )
  9. {
  10.     /* Write string to current cursor position. Only that part of the
  11.      * string that will fit on the current line is written. The cursor
  12.      * moves to the character following end of string if it can. If the
  13.      * output string was truncated, it will rest at the far right of the
  14.      * line.  Return false if the string won't fit on the line, so was
  15.      * truncated. Return true otherwise.
  16.      */
  17.  
  18.     if( v->magic != VMAGIC )
  19.         return 0;
  20.     while( *s )
  21.         if( !v_putc(v, *s++, 1) )
  22.             return 0;
  23.     return 1;
  24. }
  25.